import React from 'react';
import PropTypes from 'prop-types';
import { Spin } from 'antd';
import './style.scss';

export default function Loading(props) {
  const {
    error,
    timeOut,
    pastDelay = true,
  } = props;

  return (
    <div className="loading-container">
      {
        error ? <div>error</div>
          : timeOut ? <div>time out</div>
            : pastDelay ? <Spin size="large" />
              : null
      }
    </div>
  );
}

Loading.propTypes = {
  error: PropTypes.object,
  timeOut: PropTypes.bool,
  pastDelay: PropTypes.bool,
};
